#include <stdio.h>
#include <stdlib.h>
#include <time.h> 

void sort(int *value, int count)
{
	int temp;
	int j = 0;
	int i = 0;

outer_next:
	if(i >= count - 1)
		goto outer_end;
	j = i + 1;
inner_next:
	if(j >= count)
		goto inner_end;
	if(value[i] <= value[j])
		goto no_swap;
	temp = value[i];
	value[i] = value[j];
	value[j] = temp;
no_swap:
	j += 1;
	goto inner_next;
inner_end:
	i += 1;
	goto outer_next;
outer_end:
	;
}

void print(int *value, int count)
{
	int i = 0;

loop_next:
	if(i >= count)
		goto loop_end;
	printf("%d ", value[i]);
	i += 1;
	goto loop_next;
loop_end:
	printf("\n");
}

void randomNum(int *value, int count)
{
        int i = 0;

loop_next:
        if(i >= count)
                goto loop_end;
        value[i] = rand() % 100 + 1;
        i += 1;
        goto loop_next;
loop_end:
	;
}

int main()
{
	int i;
	int arr[10];
	srand(time(NULL));
	for(i = 0; i < 10; i++)
		arr[i] = rand() % 100 + 1;
	
	print(arr, 10);

	sort(arr, 10);
	
	print(arr, 10);

	return 0;
}
